package com.tdkj.service.risevalue.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.tdkj.dao.risevalue.IBeanFloatColorCustomDao;
import com.tdkj.model.risevalue.BeanFloatColorCustom;
import com.tdkj.service.BaseService;
import com.tdkj.service.risevalue.IBeanFloatColorCustomService;
            
@Component
public class BeanFloatColorServiceCustomImpl extends BaseService implements IBeanFloatColorCustomService{
	
	private  IBeanFloatColorCustomDao beanFloatColorCustomDao;
	                              
	@Resource
	public void setBeanFloatColorCustomDao(IBeanFloatColorCustomDao beanFloatColorCustomDao) {
		this.beanFloatColorCustomDao = beanFloatColorCustomDao;
	}

	@Override
	public void add(BeanFloatColorCustom bean) {
		beanFloatColorCustomDao.save(bean);
	}

	@Override
	public void delete(Long id) {
		BeanFloatColorCustom bean = beanFloatColorCustomDao.findById(id, BeanFloatColorCustom.class);
		beanFloatColorCustomDao.delete(bean);
	}

	@Override
	public BeanFloatColorCustom get(long id) {
		BeanFloatColorCustom bean = beanFloatColorCustomDao.findById(id, BeanFloatColorCustom.class);
		return bean;
	}

	@Override
	public List<BeanFloatColorCustom> getAll() {
		return beanFloatColorCustomDao.findAll(BeanFloatColorCustom.class);
	}

	@Override
	public void update(Long id, Integer timeLimitAmount, String timeLimitUnit, Integer price, String unit) {
		BeanFloatColorCustom bean = beanFloatColorCustomDao.findById(id, BeanFloatColorCustom.class);
		bean.setTimeLimitAmount(timeLimitAmount);
		bean.setTimeLimitUnit(timeLimitUnit);
		bean.setPrice(price);
		bean.setUnit(unit);
	}




}
